package com.lry.mqstarter.config;

import com.lry.mqstarter.extend.MqProducerRegistryPostProcessor;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;
import com.lry.mqstarter.extend.MqConsumerSmartInitializingSingleton;

import java.util.ArrayList;
import java.util.List;


public class ConfigImportSelector implements ImportSelector {

    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {

        List<String> list = new ArrayList<>();
        list.add(MqProducerRegistryPostProcessor.class.getName());
        list.add(MqConsumerSmartInitializingSingleton.class.getName());

        String[] classNames = new String[list.size()];
        list.toArray(classNames);
        return classNames;
    }
}
